package com.utils
{
	import com.error.*;
	
	public class CharUtilsMe
	{
		public static function charArray(str:String,start:uint=0,end:uint=0):Array
		{
			var _start:uint;
			var _end:uint;
			var min:uint;
			var max:uint;
			
			switch(str)
			{
				case "char":     //小写字母
					{min=97;max=122;}
					break;
				case "CHAR":    //大写字母
					{min=65;max=90;}
					break;
			}
			
			if(start<26&&end<26)
			{
				if(start<end&&start==0)
				{
					_start=min;
					_end=min+end;
				}
				if(start<end&&start!=0)
				{
					_start=min+start;
					_end=min+end;
				}
				if(start>end&&end==0)
				{
					_start=min+start;
					_end=max;
				}
				if(start==0&&end==0)
				{
					_start=min;
					_end=max;
				}
				if((start>end&&end!=0)||(start!==0&&start==end))
				{
					throw new ArgumentValueErrorMe;
				}
			}else
			{
				throw new ArgumentValueErrorMe;
			}
			
			var a:Array = [];
			for (var i:uint = _start; i <= _end; i++) 
			{
				a.push(String.fromCharCode(i));
			}
			return a;
		}
		
		public static function charNumberArray(char:String,start:Number,end:Number,equal:Number=1):Array
		{
			var a:Array = [];
			 
			if(start<end)
			{
				for (var i:Number = start; i <= end; i+=equal) 
				{
					a.push(char+i);
				}
			}else
			{
				throw new ArgumentValueErrorMe;
			}
			return a;
		}
		
		public static function weekArray():Array
		{
			return new Array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
		}
	}
}